import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable({ providedIn: 'root' })
export class SharedData {
  private searchText = new BehaviorSubject<string>('');
  public data$ = this.searchText.asObservable();
  constructor() {}
  updateData(value: string): void {
    this.searchText.next(value);
  }
  getData() {
    return this.searchText.getValue();
  }
}
